<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<%@ include file="include/Imports.jsp"%>
<title>APAC Resource Tracker</title>

<script type="text/javascript">
	function onInvokeAction(id) {
		setExportToLimit(id, '');
		createHiddenInputFieldsForLimitAndSubmit(id);
	}

	function onInvokeExportAction(id) {
		var parameterString = createParameterStringForLimit(id);
		location.href = '${resources_url}?' + parameterString;
	}
	//For Getting of Employeee Object AJAX
	// 	function getEmployeeAJAXtwo(personId){
	// 	    $.get('${pageContext.request.contextPath}/${resources_url}/'+personId+'.emp', function(employee) {
	// 			alert('FirstName: '+employee.empFirstName);
	// 		});
	// 	}	
	function getEmployeeAJAX(personId) {
		$.post("${resources_ajax_url}/" + personId, {}, function(data) {

			$('#employeeDiv').html(data);

		}, 'html');
	}

	$(document).on("click", "[id^=resources_row]", function() {
		
		getEmployeeAJAX($('#employeeId').val());
		
		$('#modalDiv').popup({
			'autoopen' : true
		});
		
	});
	
</script>
</head>

<body>

	<div id="main">

		<!-- Tray -->
		<%@ include file="include/Tray.jsp"%>


		<hr class="noscreen" />

		<!-- Menu -->
		<%@ include file="include/Menu.jsp"%>


		<hr class="noscreen" />

		<!-- Columns -->
		<div id="cols" class="box">

			<!-- Aside (Left Column) -->
			<%@ include file="include/Aside.jsp"%>


			<hr class="noscreen" />

			<!-- Content (Right Column) -->
			<div id="content" class="box">
				<%@ include file="include/Notification.jsp"%>
				<h1>Resource Tracker</h1>

				<h5>This is a system that will cater to the needs of APAC Sales
					Department of 77 Global Services.s</h5>

				<div class="longtable">
					<form action="${resources_url}">${resources}
					</form>
				</div>

				<table style="display: none;">
					<tr>
						<td>Employee</td>
						<td><input type="text" id="employeeId" /></td>
					</tr>
				</table>
				<br />

<!-- 				<div id="modalDiv" class="well" style="display:none;margin:1em;z-index: 1000"> -->
					<div id="employeeDiv" ></div>
<!-- 				</div> -->
				
			</div>
			<!-- /content -->

		</div>
		<!-- /cols -->

		<hr class="noscreen" />

		<!-- Footer -->
		<%@ include file="include/Footer.jsp"%>

	</div>
	<!-- /main -->

</body>
</html>